{/* LAYOUT模板 */}
	<layout name="layout"/>
{/* LAYOUT模板 */}
{/* import Js,Css */}
	<js href="__PUBLIC__/js/admin/listTable.js"/>
	<js href="__PUBLIC__/js/admin/js.util.js"/>
	<css href="__PUBLIC__/css/admin/common.css"/>
	<js href="__PUBLIC__/js/admin/js.selectzone.js"/>
	
	<css href="__PUBLIC__/css/jquery-ui.css" />
	<js href="__PUBLIC__/js/core/jquery-ui.1.10.4.js" />
	<js href="__PUBLIC__/js/core/plugins.js"/>
{/* import js,css */}
<!-- [position] -->
	<include file="Template:position"/>
<!-- [position] -->

<div class="form-div">
	<form action="javascript:searchActivity()" name="searchForm">
		<img src="__PUBLIC__/image/admin/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
		商品名称 
		<input type="text" name="keyword" size="30" />
		<input name="is_going" type="checkbox" id="is_going" value="1" />
		 仅显示进行中的活动
		<input type="submit" value="搜索" />
	</form>
</div>

<form method="post" action="favourable.php" name="listForm" onsubmit="return confirm(batch_drop_confirm);">
	<!-- start favourable list -->
	<div class="list-div" id="listDiv">
		<table cellpadding="3" cellspacing="1" width="100%">
			<tr>
				<th>
				<input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
				<a href="javascript:listTable.sort('act_id'); "> 编号</a>{$sort_act_id}</th>
				<th><a href="javascript:listTable.sort('act_name'); ">优惠活动名称</a>{$sort_act_name}</th>
				<th><a href="javascript:listTable.sort('start_time'); ">开始时间</a>{$sort_start_time}</th>
				<th><a href="javascript:listTable.sort('end_time'); ">结束时间</a>{$sort_end_time}</th>
				<th>金额下限</th>
				<th>金额上限</th>
				<th><a href="javascript:listTable.sort('sort_order'); ">排序</a>{$sort_sort_order}</th>
				<th>操作</th>
			</tr>
			<volist name="favourable_list" id="favourable">
			<tr>
				<td><input value="{$favourable.act_id}" name="checkboxes[]" type="checkbox">{$favourable.act_id}</td>
				<td>{$favourable.act_name}</td>
				<td align="right">{$favourable.start_time}</td>
				<td align="right">{$favourable.end_time}</td>
				<td align="right">{$favourable.min_amount}</td>
				<td align="right">{$favourable.max_amount}</td>
				<td align="center">
					<span onclick="listTable.edit(this, 'edit_sort_order', {$favourable.act_id})">{$favourable.sort_order}</span>
				</td>
				<td align="center">
					<a href="__URL__/mod_favourable?id={$favourable.act_id}" title="编辑">
						<img src="__PUBLIC__/image/admin/icon_edit.gif" border="0" height="16" width="16" />
					</a>
					<a href="__URL__/remove_favourable?id={$favourable.act_id}" onclick="listTable.remove({$favourable.act_id},'确定删除')" title="移除">
						<img src="__PUBLIC__/image/admin/icon_drop.gif" border="0" height="16" width="16" /></a>      
					</td>
			</tr>
			</volist>
		</table>
	</div>
</form>

<script type="text/javascript" language="JavaScript">

	onload = function(){
		document.forms['searchForm'].elements['keyword'].focus();
		startCheckOrder();
	}

	/**
	* 搜索团购活动
	*/
	function searchActivity(){
		var keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value);
		listTable.filter['keyword'] = keyword;
		if (document.forms['searchForm'].elements['is_going'].checked){
			listTable.filter['is_going'] = 1;
		}
		else{
			listTable.filter['is_going'] = 0;
		}
		listTable.filter['page'] = 1;
		listTable.loadList("favourable_list");
	}

</script>